<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="Vit.CMS" %>
<% DirectoryInfo dir = Model as DirectoryInfo;
   if (dir != null)
   {
       Vit.Web.Models.WebSite site = ((Vit.Web.VitApplication)this.Context.ApplicationInstance).CurrentSite;
       string root = site.PhysicalRootPath;%>
<ul>
    <% foreach (DirectoryInfo sd in dir.GetDirectories())
       {
           if (sd.Name.StartsWith("."))
               continue;
           %>
    <li><span>
        <%= Html.Localize(sd.Name)%></span>
        <% Html.RenderPartial("Index", sd); %></li>
    <%} %>
    <% foreach (FileInfo file in dir.GetFiles())
       {
           if (file.Name.EndsWith(".design.aspx"))
               continue; 
        %>
    <li>
        <%= Html.ActionLink(Html.Localize(file.Name), "Edit", new { controller = "Page", id = file.PageLink() }, new { @class = "ui-state-default ui-corner-all" })%>
    </li>
    <%} %>
    <li>
        <%= Html.ActionLink(Html.Localize("NewPage"), "Create", new { controller = "Page", id = dir.DirectoryLink() }, new { @class = "ui-state-default ui-corner-all" })%></li>
</ul>
<%} %>
